export interface ProjectFormData {
	name: String;
	/**
	 * 合同
	 */
	contract: String;
	date: String;
	customerName: String;
	conf: Array<String>;
	/**
	 * 是否依赖项目计划管理项目进度和资源
	 */
	dependPlan: Boolean;
	/**
	 * 是否将子任务汇总到项目和里程碑
	 */
	sumSubTask: Boolean;
	/**
	 * 模板
	 */
	template: String;
	/**
	 * 标记
	 */
	tag: String;
	/**
	 * 负责人
	 */
	head?: String;
	products: Object[];
}

export interface ProductComponentPart {
	name: String;
	code: String;
	bom?: String;
	featureKey?: String;
	featureValue?: String;
}

/**
 * 产品组件
 */
export interface ProductComponent {
	name: String;
	code: String;
	prev?: String;
	productName: String;
	productID: String;
	unit?: String;
	version?: String;
	parts?: ProductComponentPart[];
}

export interface ProductConfigData {
	name: String;
	id: String;
	componentName: String;
	componentId: String;
	unit: String;
	version: String;
	components?: ProductComponent[];
}

/**
 * 本项目拥有的产品列表
 */
export const productOwnComponentList: ProductComponent[] = [
	{
		name: '组件1',
		code: 'A000001',
		prev: '组件1的上级',
		productName: 'iPhone 15测试台',
		productID: 'iPhone-021018',
		unit: 'PCS',
		version: '1.0',
		parts: [
			{
				name: '第1个零件',
				code: 'SDT889',
				bom: 'bom1',
				featureKey: '特性1',
				featureValue: '特性1的值',
			},
			{
				name: '第2个零件',
				code: 'SDT890',
				bom: 'bom2',
				featureKey: '特性a',
				featureValue: '特性a的值',
			},
			{
				name: '第3个零件',
				code: 'SDT891',
				bom: 'bom3',
				featureKey: '特性H',
				featureValue: '特性H的值',
			},
		],
	},
	{
		name: '组件2',
		code: 'A000002',
		prev: '组件2的上级',
		productName: '小米14 测试台',
		productID: 'Mi-390228',
		unit: 'PCS',
		version: '1.0',
	},
];

export const productComponentList: ProductComponent[] = [
	{
		name: '组件1',
		code: 'A000001',
		prev: '组件1的上级',
		productName: 'iPhone 15测试台',
		productID: 'iPhone-021018',
		unit: 'PCS',
		version: '1.0',
		parts: [
			{
				name: '第1个零件',
				code: 'SDT889',
				bom: 'bom1',
				featureKey: '特性1',
				featureValue: '特性1的值',
			},
			{
				name: '第2个零件',
				code: 'SDT890',
				bom: 'bom2',
				featureKey: '特性a',
				featureValue: '特性a的值',
			},
			{
				name: '第3个零件',
				code: 'SDT891',
				bom: 'bom3',
				featureKey: '特性H',
				featureValue: '特性H的值',
			},
		],
	},
	{
		name: '组件2',
		code: 'A000002',
		prev: '组件2的上级',
		productName: '小米14 测试台',
		productID: 'Mi-390228',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: '华为P70 测试台',
		productID: 'Huawei-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: '华为P80 测试台',
		productID: 'Huawei-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: '华为P90 测试台',
		productID: 'Huawei-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: 'iPhone 16 测试台',
		productID: 'iPhone-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: 'iPhone 17 测试台',
		productID: 'iPhone-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: 'iPhone 18 测试台',
		productID: 'iPhone-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: 'iPhone 19 测试台',
		productID: 'iPhone-000239',
		unit: 'PCS',
		version: '1.0',
	},
	{
		name: '组件3',
		code: 'A000003',
		prev: '组件3的上级',
		productName: 'iPhone 20 测试台',
		productID: 'iPhone-000239',
		unit: 'PCS',
		version: '1.0',
	},
];

export const productConfigDataList: ProductConfigData[] = [
	{
		name: 'apple测试台',
		id: 'T100212',
		componentName: '光学驱动组件',
		componentId: 'LD240124',
		unit: 'PCS',
		version: '2.2',
		components: [
			{
				name: '组件1',
				code: 'A000001',
				prev: '组件1的上级',
				productName: 'String',
				productID: 'string',
				parts: [
					{ name: '第1个零件', code: 'SDT889' },
					{ name: '第2个零件', code: 'SDT889' },
					{ name: '第3个零件', code: 'SDT889' },
				],
			},
			{
				name: '组件2',
				code: 'A000002',
				prev: '组件2的上级',
				productName: 'String',
				productID: 'string',
			},
			{
				name: '组件3',
				code: 'A000003',
				prev: '组件3的上级',
				productName: 'String',
				productID: 'string',
			},
		],
	},
	{
		name: 'huawei测试台',
		id: 'T100213',
		componentName: '光学驱动组件',
		componentId: 'LD240124',
		unit: 'PCS',
		version: '2.2',
		components: [
			{
				name: '华为组件1',
				code: 'A000001',
				prev: '组件1的上级组件',
				productName: 'String',
				productID: 'string',
			},
			{
				name: '华为组件2',
				code: 'A000001',
				prev: '组件1的上级组件',
				productName: 'String',
				productID: 'string',
			},
			{
				name: '华为组件3',
				code: 'A000001',
				prev: '组件1的上级组件',
				productName: 'String',
				productID: 'string',
			},
			{
				name: '华为组件4',
				code: 'A000001',
				prev: '组件1的上级组件',
				productName: 'String',
				productID: 'string',
			},
			{
				name: '华为组件5',
				code: 'A000001',
				prev: '组件1的上级组件',
				productName: 'String',
				productID: 'string',
			},
		],
	},
	{
		name: 'xiaomi测试台',
		id: 'T100213',
		componentName: '光学驱动组件',
		componentId: 'LD240124',
		unit: 'PCS',
		version: '2.2',
	},
];

interface mainPlanTask {
	id: Number;
	code: String;
	name: String;
	prev?: String;
	next?: String;
}

/**
 * 项目主计划任务列表
 */
export const mainPlanTaskList: Array<mainPlanTask> = [
	{ id: 5, code: 'AST025228', name: '安装', prev: '组装', next: 'ATD测试' },
	{ id: 8, code: 'HDR025359', name: '耐压', prev: '组装', next: 'EOL测试' },
	{ id: 10, code: 'CTB025339', name: 'BUS测试', prev: 'EOL测试', next: 'ATD测试' },
];

/**
 * 产品配置
 */
export interface ProductConfig {
	/**
	 * 产品名称
	 */
	name: String;
	/**
	 * 产品编码
	 */
	code: String;
	/**
	 * 产品包含的组件
	 */
	components: Array<ProductComponent>;

	files: [];
}
